package com.xiaoxu.content.feignclient;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author xiaoxu
 * @version 1.0
 * @description TODO
 * @date 2023/1/31 18:24
 */
@Component
@Slf4j
public class SearchServiceClientFallBackFactory implements FallbackFactory<SearchServiceClient> {
    @Override
    public SearchServiceClient create(Throwable throwable) {
        return courseIndex -> {
            log.debug("远程调用媒资管理服务熔断异常: {}",throwable.getMessage());
            throwable.printStackTrace();
            return false;
        };
    }
}
